#!/bin/bash
n=0
cat 56.txt | while read line
do
    n=$[$n+1]
    if [ $n -eq 5 ]
    then
        echo $line
        echo -e "# This is a test file.\n# Test insert line into this file"
    else
        echo $line
    fi
done

# sed 表示控制台，文件不生效
# sed  '5a # This is a test file.\n# Test insert line into this file' 56.txt

# sed -i 表示生效
# sed  '5a # This is a test file.\n# Test insert line into this file' 56.txt